Component({
    properties: {
        secondlist: {
            type: Object,
            value: {}
        },
        secondid: {
            type: String
        }
    },
    data: {
        id: "",
        scrollLeft: 0
    },
    attached: function() {
        this.classInit();
    },
    onReady: function() {
        this.aliginCenter();
    },
    methods: {
        selectTab: function(t) {
            var e = t.currentTarget.dataset.index, a = wx.getSystemInfoSync().windowWidth, n = t.detail.x, i = t.currentTarget.offsetLeft, s = t.currentTarget.dataset.secondid;
            this.setData({
                id: e
            });
            var c = 0;
            c = n > a / 2 ? i < a ? i / 2 : i - n / 2 : i < a ? i / 2 : i - (a / 2 - n), e < 2 && (c = 0), 
            this.setData({
                scrollLeft: c
            });
            var d = {
                tab_name: t.currentTarget.dataset.name,
                cy2_sort: e,
                secondid: s
            };
            this.triggerEvent("getTabSecondid", d);
        },
        scrollHandel: function(t) {
            this.data.scrollLeft = t.detail.scrollLeft;
        },
        classInit: function() {
            var t = this.data.secondlist, e = this.data.secondid, a = this;
            t.forEach(function(t, n) {
                e == t.secondId && a.setData({
                    id: n
                });
            });
        },
        aliginCenter: function() {}
    }
});